﻿@model VietPremier.Models.GetPromotionModel
@{
    if (Model != null)
    {
        ViewBag.Title = Model.promotion.Titletag;
        ViewBag.Description = Model.promotion.Meta_description;
        ViewBag.Keywords = Model.promotion.Meta_keyword;
    }
}

@helper Truncate(string input, int length)
{
    if (input.Length <= length)
    { 
    @Html.Raw(input)
    }
    else
    { 
    @Html.Raw(input.Substring(0, length))<text>...</text>
    }
}

<script type="text/javascript">
    jQuery(document).ready(function () {
        checkStart();
    });

    function checkStart() {
        $("#li-itinerary").addClass("active");
        $("#itinerary").addClass("tab-pane scroll-pane active");
    }

    function tab_PriceBooking() {
        $("#li-price-booking").addClass("active");
        $("#price-booking").addClass("tab-pane scroll-pane active");

        $("#li-itinerary").removeClass("active");
        $("#itinerary").removeClass();
        $("#itinerary").addClass("tab-pane scroll-pane");
        return false;
    }

    function tab_Itinerary() {
        $("#li-itinerary").addClass("active");
        $("#itinerary").addClass("tab-pane scroll-pane active");

        $("#li-price-booking").removeClass("active");
        $("#price-booking").removeClass();
        $("#price-booking").addClass("tab-pane scroll-pane");
        return false;
    }

</script>

@{
    if (!string.IsNullOrEmpty(TempData["ContactUs"] as string))
    {
        var getInfo = TempData["ContactUs"].ToString();
        
    <script type="text/javascript">
        jQuery(document).ready(function () {
            checkSubmit();
        });
        function checkSubmit() {
            msg = '@getInfo';
            if (msg == "Error") {
                $("#li-price-booking").addClass("active");
                $("#price-booking").addClass("tab-pane scroll-pane active");

                $("#li-itinerary").removeClass("active");
                $("#itinerary").removeClass();
                $("#itinerary").addClass("tab-pane scroll-pane");
                return false;
            } else {
            }
        }
    </script>
    }
}

@{
    if (!string.IsNullOrEmpty(TempData["Message"] as string))
    {
        var getInfo = TempData["Message"].ToString();
        
    <script type="text/javascript">
        jQuery(document).ready(function () {
            checkSubmit();
        });
        function checkSubmit() {
            msg = '@getInfo';
            if (msg == "ErrorMessage") {
                alert("Lỗi server, không thể gửi email. Vui lòng liên hệ trực tiếp với chúng tôi!")
                $("#li-price-booking").addClass("active");
                $("#price-booking").addClass("tab-pane scroll-pane active");

                $("#li-itinerary").removeClass("active");
                $("#itinerary").removeClass();
                $("#itinerary").addClass("tab-pane scroll-pane");
                return false;
            } else {
                alert("Nội dung của bạn đã được gửi tới email của chúng tôi!")
                $("#li-price-booking").addClass("active");
                $("#price-booking").addClass("tab-pane scroll-pane active");

                $("#li-itinerary").removeClass("active");
                $("#itinerary").removeClass();
                $("#itinerary").addClass("tab-pane scroll-pane");
                return false;
            }
        }
    </script>
    }
}


<div class="content container-fluid">
    <div class="row-fluid">
        <div class="span3">
            @Html.Partial("_Maps")
            <!--/ .box-->
            @Html.Action("Onlinesupport", "Home")
            <!--/ .support-->
            @Html.Action("Spotlight", "Home")
            <!--/ .box-->

        </div>
        <!--/ .span3-->
        <div class="span9">
            <div class="link-page">
                <a href="@Url.Action("Index", "Home")">Home&nbsp;<img src="../../Content/cssFrontEnd/images/iconmt.png">&nbsp;</a>
                <a href="#">Promotion&nbsp;<img src="../../Content/cssFrontEnd/images/iconmt.png">&nbsp;</a>
                @if (Model != null)
                {
                    <span>@Model.promotion.Name</span>
                }
            </div>

            <div class="box-about">
                @if (Model != null)
                {
                    <h1 class="title">@Model.promotion.Name</h1>
                    @Html.Raw(Model.promotion.Description)
                    <ul class="nav nav-tabs destination">
                        <li id="li-itinerary"><a href="#itinerary" onclick="tab_Itinerary()" data-toggle="tab">Hành trình</a></li>
                        <li id="li-price-booking"><a href="#price-booking" onclick="tab_PriceBooking()" data-toggle="tab">Giá & Đặt chỗ</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane scroll-pane" id="itinerary">
                            @Html.Raw(Model.promotion.Itinerary)
                        </div>
                        <div class="tab-pane scroll-pane" id="price-booking">
                            <h5>Quy định:</h5>
                            @Html.Raw(Model.promotion.Note)

                            <h5>Liên hệ:</h5>
                            @using (Html.BeginForm("Index", "Promotion", FormMethod.Post, new { enctype = "multipart/form-data" }))
                            {
                                <div class="form">
                                    <div class="row">
                                        <div class="label">Đơn vị/ Doanh nghiệp</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.Supplier, new { @class = "input-xlarge" })
                                            @Html.ValidationMessageFor(model => model.Supplier)
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Người liên hệ</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.FullName, new { @class = "input-xlarge" })
                                            @Html.ValidationMessageFor(model => model.FullName)
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Giới tính</div>
                                        <div class="textbox">
                                            <label class="radio inline">
                                                @Html.RadioButton("Gender", "Ông.", true)
                                                Nam
                                            </label>
                                            <label class="radio inline">
                                                @Html.RadioButton("Gender", "Bà.", false)
                                                Nữ
                                            </label>
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Điện thoại</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.Telephone)
                                            @Html.ValidationMessageFor(model => model.Telephone)
                                            <p>
                                                <i>Please send us your mobile or land phone coundtry/area code and number at home and work in case we need to ring you to discuss and requirements or if problem with email correspondance occrus.(*)
                                                </i>
                                            </p>
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Email</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.Email)
                                            @Html.ValidationMessageFor(model => model.Email)
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Quốc tịch</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.Nationality)
                                            @Html.ValidationMessageFor(model => model.Nationality)
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Nơi đến</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.Destination)
                                            @Html.ValidationMessageFor(model => model.Destination)
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Chuẩn khách sạn</div>
                                        <div class="textbox">
                                            @*@Html.DropDownList("Place", Model.category as SelectList, "--Select a standard--", new { id = "idPlace", @class = "select" })
                                    @Html.ValidationMessageFor(model => model.Place)*@
                                            @Html.DropDownListFor(model => model.Place, new List<SelectListItem>{
                                                               new SelectListItem(){Text="Luxury",Value="Luxury"},
                                                               new SelectListItem(){Text="First Class",Value="First Class"},
                                                               new SelectListItem(){Text="Deluxe",Value="Deluxe"},
                                                               new SelectListItem(){Text="Superior",Value="Superior"},
                                                               new SelectListItem(){Text="Mid-range",Value="Mid-range"}})
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Ngày đi</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.DateFrom, new { placeholder = "dd/mm/yy", @class = "date", id = "date-from" })
                                            @Html.ValidationMessageFor(model => model.DateFrom)
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Ngày về</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.DateTo, new { placeholder = "dd/mm/yy", @class = "date", id = "date-to" })
                                            @Html.ValidationMessageFor(model => model.DateTo)
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Số lượng người lớn</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.NumberofAdults)
                                            @Html.ValidationMessageFor(model => model.NumberofAdults)
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Số lượng trẻ em</div>
                                        <div class="textbox">
                                            @Html.TextBoxFor(model => model.NumberofChildren)
                                            @Html.ValidationMessageFor(model => model.NumberofChildren)
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="label">Yêu cầu đặc biệt khác</div>
                                        <div class="textbox">
                                            @Html.TextAreaFor(model => model.SpecialRequest, new { @class = "input-xlarge", @rows = 4 })
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="row">
                                        <div class="textbox">
                                            <button name="btnSend" type="submit" class="btn btn-large btn-submit">Gửi</button>
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                </div>
                            }

                        </div>
                        <!--/ .tab-pane-->
                    </div>
                    <!--/ .tab-content-->
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#promotion" data-toggle="tab">Promotion</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="promotion">
                            <div class="span12 wheretosay">
                                @*@foreach (var travelHotel in Model.listTravelHotel)
                                {
                                    var imageFile = string.Concat("~/Content/upload/travelhotels/", travelHotel.Image);
                                    <div class="it">
                                        <div class="img">
                                            <div class="img-inner">
                                                <a href="#">
                                                    <img src="@Url.Content(imageFile)" ></a>
                                            </div>
                                        </div>
                                        <h4><a class="title" href="#">@travelHotel.Name</a></h4>
                                        @if (travelHotel.Rate == 1)
                                        {
                                            <i class="icon-vote-1"></i>
                                        }
                                        else if (travelHotel.Rate == 2)
                                        {
                                            <i class="icon-vote-2"></i>
                                        }
                                        else if (travelHotel.Rate == 3)
                                        {
                                            <i class="icon-vote-3"></i>
                                        }
                                        else if (travelHotel.Rate == 4)
                                        {
                                            <i class="icon-vote-4"></i>
                                        }
                                        else if (travelHotel.Rate == 5)
                                        {
                                            <i class="icon-vote-5"></i>
                                        }
                                        <small class="tripcode">Add: @travelHotel.Address</small>
                                        <small class="price">Hotline: (+84) @travelHotel.Phone</small>
                                    </div>
                                    <!--/ .it-->
                                }*@

                                @foreach (var promotion in Model.listPromotion)
                                {
                                    var imageFile = string.Concat("~/Content/upload/promotions/", promotion.Image);
                                    <div class="it">
                                        <div class="img">
                                            <div class="img-inner">
                                                <a href="@Url.Action("Detail", "Promotion", new { title = Utilities.Encode(@promotion.Name) })">
                                                    <img src="@Url.Content(imageFile)" style="width:150px; height:88px"></a>
                                            </div>
                                        </div>
                                        <h4><a class="title" href="@Url.Action("Detail", "Promotion", new { title = Utilities.Encode(@promotion.Name) })">@promotion.Name</a></h4>
                                        <small class="tripcode">@Truncate(promotion.Description, 300)</small>
                                    </div>
                                    <!--/ .it-->
                                }
                            </div>
                        </div>
                    </div>
                }
                else
                {
                    <h1 class="title">This page is updated content</h1>
                }
            </div>
            <!--/ .box-about-->
        </div>
    </div>
    <!--/ .row-fluid-->
</div>
<!--/ .span9-->


